|
2000W / 48V LLC Battery-Charger
V1.00
|
Universal Asynchronous Receiver/Transmitter (UART) driver for XMC microcontroller family. More...
|
Classes | |
| struct | XMC_UART_CH_CONFIG |
Typedefs | |
| typedef enum XMC_UART_CH_STATUS | XMC_UART_CH_STATUS_t |
| typedef enum XMC_UART_CH_STATUS_FLAG | XMC_UART_CH_STATUS_FLAG_t |
| typedef enum XMC_CH_UART_EVENT | XMC_UART_CH_EVENT_t |
| typedef enum XMC_UART_CH_INPUT_SAMPLING_FREQ | XMC_UART_CH_INPUT_SAMPLING_FREQ_t |
| typedef enum XMC_UART_CH_INPUT | XMC_UART_CH_INPUT_t |
| typedef enum XMC_UART_CH_INTERRUPT_NODE_POINTER | XMC_UART_CH_INTERRUPT_NODE_POINTER_t |
| typedef struct XMC_UART_CH_CONFIG | XMC_UART_CH_CONFIG_t |
Universal Asynchronous Receiver/Transmitter (UART) driver for XMC microcontroller family.
The UART driver uses Universal Serial Interface Channel(USIC) module to implement UART protocol. It provides APIs to configure USIC channel for UART communication. The driver enables the user in getting the status of UART protocol events, configuring interrupt service requests, protocol related parameter configuration etc.
UART driver features:
| typedef struct XMC_UART_CH_CONFIG XMC_UART_CH_CONFIG_t |
UART initialization structure
| typedef enum XMC_CH_UART_EVENT XMC_UART_CH_EVENT_t |
UART configuration events. The enums can be used for configuring events using the CCR register.
UART Input sampling frequency options
| typedef enum XMC_UART_CH_INPUT XMC_UART_CH_INPUT_t |
UART input stages
UART channel interrupt node pointers
| typedef enum XMC_UART_CH_STATUS_FLAG XMC_UART_CH_STATUS_FLAG_t |
UART portocol status. The enum values can be used for getting the status of UART channel.
| typedef enum XMC_UART_CH_STATUS XMC_UART_CH_STATUS_t |
UART driver status
| enum XMC_CH_UART_EVENT |
UART configuration events. The enums can be used for configuring events using the CCR register.
Definition at line 160 of file xmc_uart.h.
| enum XMC_UART_CH_INPUT |
UART input stages
| Enumerator | |
|---|---|
| XMC_UART_CH_INPUT_RXD | UART input stage DX0 |
Definition at line 189 of file xmc_uart.h.
UART Input sampling frequency options
| Enumerator | |
|---|---|
| XMC_UART_CH_INPUT_SAMPLING_FREQ_FPERIPH | Sampling frequency input fperiph |
| XMC_UART_CH_INPUT_SAMPLING_FREQ_FRACTIONAL_DIVIDER | Sampling frequency input fractional divider |
Definition at line 180 of file xmc_uart.h.
UART channel interrupt node pointers
Definition at line 203 of file xmc_uart.h.
| enum XMC_UART_CH_STATUS |
UART driver status
| Enumerator | |
|---|---|
| XMC_UART_CH_STATUS_OK | UART driver status : OK |
| XMC_UART_CH_STATUS_ERROR | UART driver status : ERROR |
| XMC_UART_CH_STATUS_BUSY | UART driver status : BUSY |
Definition at line 125 of file xmc_uart.h.
UART portocol status. The enum values can be used for getting the status of UART channel.
Definition at line 136 of file xmc_uart.h.
| __STATIC_INLINE void XMC_UART_CH_ClearStatusFlag | ( | XMC_USIC_CH_t *const | channel, |
| const uint32_t | flag | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| flag | UART events to be cleared. Range: Use XMC_UART_CH_STATUS_FLAG_t enumerations for event bitmasks. XMC_UART_CH_STATUS_FLAG_TRANSMISSION_IDLE, XMC_UART_CH_STATUS_FLAG_RECEPTION_IDLE, XMC_UART_CH_STATUS_FLAG_SYNCHRONIZATION_BREAK_DETECTED etc. |
Definition at line 559 of file xmc_uart.h.
Referenced by XMC_UART_CH_Transmit().

| __STATIC_INLINE void XMC_UART_CH_DisableDataTransmission | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 829 of file xmc_uart.h.

| void XMC_UART_CH_DisableEvent | ( | XMC_USIC_CH_t *const | channel, |
| const uint32_t | event | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| event | Bitmask of events to disable. Use the type XMC_UART_CH_EVENT_t for naming events. Range: XMC_UART_CH_EVENT_RECEIVE_START, XMC_UART_CH_EVENT_DATA_LOST, XMC_UART_CH_EVENT_TRANSMIT_SHIFT, XMC_UART_CH_EVENT_TRANSMIT_BUFFER, etc. |
Definition at line 212 of file xmc_uart.c.
| __STATIC_INLINE void XMC_UART_CH_DisableInputDigitalFilter | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 735 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_DisableInputInversion | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 699 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_DisableInputSync | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 770 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_DisableMasterClock | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 640 of file xmc_uart.h.
| __STATIC_INLINE void XMC_UART_CH_EnableDataTransmission | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 811 of file xmc_uart.h.

| void XMC_UART_CH_EnableEvent | ( | XMC_USIC_CH_t *const | channel, |
| const uint32_t | event | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| event | Event bitmasks to enable. Use the type XMC_UART_CH_EVENT_t for naming events. Range: XMC_UART_CH_EVENT_RECEIVE_START, XMC_UART_CH_EVENT_DATA_LOST, XMC_UART_CH_EVENT_TRANSMIT_SHIFT, XMC_UART_CH_EVENT_TRANSMIT_BUFFER, etc. |
Definition at line 206 of file xmc_uart.c.
| __STATIC_INLINE void XMC_UART_CH_EnableInputDigitalFilter | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 717 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_EnableInputInversion | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 680 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_EnableInputSync | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
Definition at line 752 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_EnableMasterClock | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 624 of file xmc_uart.h.
| uint16_t XMC_UART_CH_GetReceivedData | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 172 of file xmc_uart.c.
| __STATIC_INLINE uint32_t XMC_UART_CH_GetStatusFlag | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 536 of file xmc_uart.h.
Referenced by XMC_UART_CH_Stop().

| void XMC_UART_CH_Init | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_CONFIG_t *const | config | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0, XMC_UART1_CH1,XMC_UART2_CH0, XMC_UART2_CH1 |
| config | Constant pointer to UART configuration structure of type XMC_UART_CH_CONFIG_t. |
Definition at line 78 of file xmc_uart.c.
Referenced by L0_USART_Config().


| __STATIC_INLINE void XMC_UART_CH_SelectInterruptNodePointer | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INTERRUPT_NODE_POINTER_t | interrupt_node, | ||
| const uint32_t | service_request | ||
| ) |
| channel | Pointer to USIC channel handler of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| interrupt_node | Interrupt node pointer to be configured. Range: XMC_UART_CH_INTERRUPT_NODE_POINTER_TRANSMIT_SHIFT, XMC_UART_CH_INTERRUPT_NODE_POINTER_TRANSMIT_BUFFER etc. |
| service_request | Service request number. Range: 0 to 5. |
Definition at line 491 of file xmc_uart.h.

| XMC_UART_CH_STATUS_t XMC_UART_CH_SetBaudrate | ( | XMC_USIC_CH_t *const | channel, |
| uint32_t | rate, | ||
| uint32_t | oversampling | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1 ,XMC_UART1_CH0, XMC_UART1_CH1, XMC_UART2_CH0, XMC_UART2_CH1 |
| rate | Desired baudrate. Range: minimum value = 100, maximum value depends on the peripheral clock frequency and oversampling. Maximum baudrate can be derived using the formula: (fperiph * 1023)/(1024 * oversampling) |
| oversampling | Required oversampling. The value indicates the number of time quanta for one symbol of data. This can be related to the number of samples for each logic state of the data signal. Range: 4 to 32. Value should be chosen based on the protocol used. |
Definition at line 134 of file xmc_uart.c.

| __STATIC_INLINE void XMC_UART_CH_SetFrameLength | ( | XMC_USIC_CH_t *const | channel, |
| const uint8_t | frame_length | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| frame_length | Number of data bits in each UART frame. Range: minimum= 1, maximum= 64. |
Definition at line 405 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_SetInputSamplingFreq | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input, | ||
| const XMC_UART_CH_INPUT_SAMPLING_FREQ_t | sampling_freq | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). |
| sampling_freq | Input sampling frequency. Range: XMC_UART_CH_INPUT_SAMPLING_FREQ_FPERIPH, XMC_UART_CH_INPUT_SAMPLING_FREQ_FRACTIONAL_DIVIDER. |
Definition at line 790 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_SetInputSource | ( | XMC_USIC_CH_t *const | channel, |
| const XMC_UART_CH_INPUT_t | input, | ||
| const uint8_t | source | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| input | UART channel input stage of type XMC_UART_CH_INPUT_t. Range: XMC_UART_CH_INPUT_RXD (for DX0), XMC_UART_CH_INPUT_RXD1 (for DX3), XMC_UART_CH_INPUT_RXD2 (for DX5). | ||||||||||||||||
| source | Input source select for the input stage. The table provided below maps the decimal value with the input source.
|
Definition at line 585 of file xmc_uart.h.
Referenced by L0_USART_Config().


| __STATIC_INLINE void XMC_UART_CH_SetInterruptNodePointer | ( | XMC_USIC_CH_t *const | channel, |
| const uint8_t | service_request | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| service_request | Service request number for generating protocol interrupts. Range: 0 to 5. |
Definition at line 465 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_SetPulseLength | ( | XMC_USIC_CH_t *const | channel, |
| const uint8_t | pulse_length | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| pulse_length | Length of the zero pulse in number of time quanta. Range: 0 to 7. |
Definition at line 606 of file xmc_uart.h.
| __STATIC_INLINE void XMC_UART_CH_SetSamplePoint | ( | XMC_USIC_CH_t *const | channel, |
| const uint32_t | sample_point | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| sample_point | Sample point among the number of samples. Range: minimum= 0, maximum= oversampling (DCTQ). |
Definition at line 660 of file xmc_uart.h.
| __STATIC_INLINE void XMC_UART_CH_SetWordLength | ( | XMC_USIC_CH_t *const | channel, |
| const uint8_t | word_length | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| word_length | Data word length. Range: minimum= 1, maximum= 16. |
Definition at line 384 of file xmc_uart.h.

| __STATIC_INLINE void XMC_UART_CH_Start | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 278 of file xmc_uart.h.
Referenced by L0_USART_Config().

| XMC_UART_CH_STATUS_t XMC_UART_CH_Stop | ( | XMC_USIC_CH_t *const | channel | ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
Definition at line 189 of file xmc_uart.c.

| void XMC_UART_CH_Transmit | ( | XMC_USIC_CH_t *const | channel, |
| const uint16_t | data | ||
| ) |
| channel | Constant pointer to USIC channel handle of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| data | Data to be transmitted. Range: 16 bit unsigned data within the range 0 to 65535. Actual size of data transmitted depends on the configured number of bits for the UART protocol in the register SCTR. |
Note: When FIFO is not configured, the API waits for the TBUF to be available. This makes the execution a blocking call.
Definition at line 150 of file xmc_uart.c.

| __STATIC_INLINE void XMC_UART_CH_TriggerServiceRequest | ( | XMC_USIC_CH_t *const | channel, |
| const uint32_t | service_request_line | ||
| ) |
| channel | Pointer to USIC channel handler of type XMC_USIC_CH_t Range: XMC_UART0_CH0, XMC_UART0_CH1,XMC_UART1_CH0,XMC_UART1_CH1,XMC_UART2_CH0,XMC_UART2_CH1 |
| service_request_line | service request number of the event to be triggered. Range: 0 to 5. |
Definition at line 514 of file xmc_uart.h.
